all: P051.pdf P051-poster.pdf

P051-poster.pdf: P051-poster.tex
	TEXINPUTS=images: xelatex $<

P051.pdf: P051.ps
	ps2pdf14 $<
P051.ps: P051.dvi
	dvips -Ppdf $<
P051.dvi: P051.tex P051.bbl ogsadai-architecture.eps hg.id
	TEXINPUTS=style/ASPauthorTemplates: latex $<

P051.bbl: P051.aux P051.bib
	BSTINPUTS=style/ASPauthorTemplates: bibtex P051

P051.bib: ../astrodabis.bib
	cp ../astrodabis.bib P051.bib

# Create a dummy .aux file for the first time round
P051.aux:
	echo '\\relax\n\\bibstyle{unsrturl}\n\\bibdata{../astrodabis}\n' >$@

ogsadai-architecture.eps: ../design/ogsadai-architecture.png
	convert ../design/ogsadai-architecture.png $@

hg.id: ../../.hg
	hg tip --template '\\def\\HgNode\{{node|short}}\n\\def\\HgDate\{{date|isodate}}\n\\def\\HgAuthor\{{author|person}}\n\\def\\HgRev\{{rev}}\n' >$@


clean:
	rm -f hg.id ogsadai-architecture.eps P051.bib
	rm -f *.dvi *.aux *.log *.ps *.pdf
